/*
 * Copyright (c) 2017 Qunar.com. All Rights Reserved.
 */
package com.guoyu.project.web.api;

import java.util.Map;

import javax.annotation.Resource;

import com.guoyu.project.common.pagination.Pagination;
import com.guoyu.project.common.web.APIResponse;
import com.guoyu.project.model.Banner;
import com.guoyu.project.service.BannerService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.google.common.collect.Maps;
/**
 * @author: libo Date: 17-2-13 Time: 下午2:18
 * @version: \$Id$
 */
@Controller
@RequestMapping("api/banner")
public class BannerApiController {

    @Resource
    private BannerService bannerService;

    @RequestMapping("list")
    @ResponseBody
    public APIResponse list() {
        Map<String, Object> params = Maps.newHashMap();
        Pagination<Banner> pagination = bannerService.queryBanners(1, 20, params);
        return APIResponse.returnSuccess(pagination);
    }
}
